
import { Component } from "react";

import { Provider } from './context.js';
import TopicList from "./TopicList.jsx";

import './TopicContainer.css';

class TopicContainer extends Component {
    render(){

        let topics = [
            { id: 1001, title: '什么时候放假?' },
            { id: 2002, title: '不放假的话能出去也行嘛！' },
            { id: 1000, title: '啥时候不下雨?' },
        ];

        return (
            <Provider value={ topics }>
                <div className="wrapper first">
                    { topics.map( (topic,index) => (<p key={topic.id}>{index+1} : {topic.title}</p>) ) }
                </div>

                <TopicList />
            </Provider>
        )
    }
}

export default TopicContainer;